bitkeeper revision 1.358.2.1 (3f1bb7afICZyxwHMLR8ad8KA9BhNVw)
authorrneugeba@wyvis.research <rneugeba@wyvis.research>
Mon, 21 Jul 2003 09:51:43 +0000 (09:51 +0000)
committerrneugeba@wyvis.research <rneugeba@wyvis.research>
Mon, 21 Jul 2003 09:51:43 +0000 (09:51 +0000)
fix virtual time overrun

BitKeeper/etc/logging_ok
xen/common/schedule.c
xen/include/xeno/sched.h

index 8f77187647ef6197e62bc2057385f88f76fc4cc5..cfbe12074284a1372bbbafd91edf36cf8855ab14 100644 (file)
@@ -19,6 +19,7 @@ rac61@labyrinth.cl.cam.ac.uk
 rgr22@boulderdash.cl.cam.ac.uk
 rn@wyvis.camb.intel-research.net
 rn@wyvis.research.intel-research.net
+rneugeba@wyvis.research
 rneugeba@wyvis.research.intel-research.net
 smh22@boulderdash.cl.cam.ac.uk
 smh22@labyrinth.cl.cam.ac.uk
index 900728175fb8e4880fe14cbaa2491873b414b609..cbb2193976299ae8c139fbedb885c17673e1a44b 100644 (file)
@@ -314,7 +314,7 @@ asmlinkage void schedule(void)
 
     now = NOW();
 
-    /* remove timer, if till on list  */
+    /* remove timer, if still on list  */
     rem_ac_timer(&schedule_data[this_cpu].s_timer);
 
     /* deschedule the current domain */
@@ -382,7 +382,6 @@ asmlinkage void schedule(void)
     next_prime_evt = 0xffffffff;
     min_avt        = 0xffffffff;    /* to calculate svt */
 
-
     list_for_each(tmp, &schedule_data[this_cpu].runqueue) {
         p = list_entry(tmp, struct task_struct, run_list);
         if (p->evt < next_evt) {
@@ -406,6 +405,22 @@ asmlinkage void schedule(void)
     /* update system virtual time  */
     if (min_avt != 0xffffffff) schedule_data[this_cpu].svt = min_avt;
 
+    /* check for virtual time overrun on this cpu */
+    if (schedule_data[this_cpu].svt >= 0xf0000000) {
+        u_long t_flags; 
+        write_lock_irqsave(&tasklist_lock, t_flags); 
+        p = &idle0_task;
+        do {
+            if (p->processor == this_cpu && !is_idle_task(p)) {
+                p->evt -= 0xe0000000;
+                p->avt -= 0xe0000000;
+            }
+        } while ( (p = p->next_task) != &idle0_task );
+        write_unlock_irqrestore(&tasklist_lock, t_flags); 
+        schedule_data[this_cpu].svt -= 0xe0000000;
+    }
+
+    /* work out time for next run through scheduler */
     if (is_idle_task(next)) {
         r_time = ctx_allow;
         goto sched_done;
@@ -449,6 +464,7 @@ asmlinkage void schedule(void)
 
     spin_unlock_irq(&schedule_data[this_cpu].lock);
 
+    /* done, switch tasks */
     if ( unlikely(prev == next) )
     {
         /* We won't go through the normal tail, so do this by hand */
index ffec7d427b34d1c7d34e21aa13a26e7141da52be..9af0b54e1239613f13efa5dcec1a7492d55368aa 100644 (file)
@@ -115,8 +115,8 @@ struct task_struct
     s_time_t wokenup;               /* time domain got woken up */
 
     unsigned long mcu_advance;      /* inverse of weight */
-    s32  avt;                       /* actual virtual time */
-    s32  evt;                       /* effective virtual time */
+    u32  avt;                       /* actual virtual time */
+    u32  evt;                       /* effective virtual time */
     int  warpback;                  /* warp?  */
     long warp;                      /* virtual time warp */
     long warpl;                     /* warp limit */